<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>蓝源Eloan-P2P平台->用户登录</title>
    <link rel="stylesheet" href="/js/bootstrap-3.3.2-dist/css/bootstrap.css" type="text/css"/>
    <link rel="stylesheet" href="/css/core.css" type="text/css"/>
    <script type="text/javascript" src="/js/jquery/jquery-2.1.3.js"></script>
    <script type="text/javascript" src="/js/bootstrap-3.3.2-dist/js/bootstrap.js"></script>
    <script type="text/javascript" src="/js/jquery.bootstrap.min.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery-validation/jquery.validate.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery-validation/localization/messages_zh.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery.form.js"></script>

    <style type="text/css">
        .el-login-form {
            width: 600px;
            margin-left: auto;
            margin-right: auto;
            margin-top: 20px;
        }

        .el-login-form .form-control {
            width: 220px;
            display: inline;
        }

        div.main {
            margin-top: 100px;
            margin-bottom: 150px;
        }
    </style>

    <script type="text/javascript">
        $(function () {
            //自定义校验规则,手机号码
            $.validator.addMethod("mobile", function (value, element) {
                var regex = /^1[3|4|5|7|8][0-9]{9}$/;
                return regex.test(value);
            }, "手机号码格式错误");

            $("#loginForm").validate({
                rules: {
                    username: {
                        required: true,
                        mobile: 'mobile'
                    },
                    password: {
                        required: true,
                        rangelength: [4, 16]
                    }
                }, messages: {
                    username: {
                        required: "手机号码不能为空"
                    },
                    password: {
                        required: "密码不能为空",
                        rangelength: "密码在4到16位之间"
                    }
                },
                //校验失败样式
                errorClass: "text-danger",
                //校验失败如何处理
                highlight: function (currentInput, errorClass) {
                    $(currentInput).closest(".form-group").addClass("has-error");
                },
                //检验通过如何处理
                unhighlight: function (currentInput, errorClass) {
                    $(currentInput).closest(".form-group").removeClass("has-error").addClass("has-success");
                },
                //提交表单
                submitHandler: function () {
                    $("#loginForm").ajaxSubmit({
                        success: function (data) {
                            if (data.success) {
                                $.messager.popup("登录成功");
                                // $.messager.confirm("提示", "登录成功,点击进入个人中心页面", function () {
                                window.location.href = "/personal";
                                // });
                            } else {
                                $.messager.popup(data.msg);
                            }
                        }
                    });
                }
            });
        });

    </script>

</head>
<body>
<!-- 网页头信息 -->
<div class="el-header">
    <div class="container" style="position: relative;">
        <ul class="nav navbar-nav navbar-right">
            <li><a href="/">首页</a></li>
            <li><a href="/login.html">登录</a></li>
            <li><a href="#">帮助</a></li>
        </ul>
    </div>
</div>

<!-- 网页导航 -->
<div class="navbar navbar-default el-navbar">
    <div class="container">
        <div class="navbar-header">
            <a href=""><img alt="Brand" src="/images/logo.png"></a>
            <span class="el-page-title">用户登录</span>
        </div>
    </div>
</div>

<!-- 网页内容 -->
<div class="container main">
    <form id="loginForm" class="form-horizontal el-login-form" action="/login" method="post">
        <p class="h4" style="margin: 10px 10px 20px 110px;color:#999;">请输入用户名和密码</p>
        <div class="form-group">
            <label class="control-label col-sm-2">用户名</label>
            <div class="col-sm-10">
                <input type="text" autocomplete="off" name="username" class="form-control" value="13712345678"/>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-sm-2">密&emsp;码</label>
            <div class="col-sm-10">
                <input type="password" autocomplete="off" name="password" class="form-control" value="1111"/>
            </div>
        </div>
        <div class="form-gorup">
            <div class="col-sm-offset-3">
                <button type="submit" class="btn btn-success" style="width: 100px;">
                    登录
                </button>
                &emsp;&emsp;
                <a href="/register.html">新用户，马上注册</a>
            </div>
        </div>
    </form>
</div>


<!-- 网页版权 -->
<div class="container-foot-2">
    <div class="context">
        <div class="left">
            <p>版权所有：叩丁狼教育</p>
            <p>广州总部：广州市天河区棠下涌东路大地工业区D栋六楼</p>
            <p>北京校区：北京昌平区沙河镇万家灯火装饰城2楼8077号</p>
            <p>上海校区：上海市青浦区华新镇华隆路1777号E通世界商务园华新园A座4楼402</p>
            <p>电&emsp;&emsp;话： 020-85628002&emsp;&emsp;
                邮箱：&emsp;service@wolfcode.cn</p>
            <p>
                <a href="http://www.miitbeian.gov.cn" style="color: #ffffff">ICP备案
                    ：粤ICP备字17147191号-1</a>
            </p>
        </div>
        <div class="right">
            <a target="_blank" href="#"><img src="/images/wx-hover.png" title="微信"></a>
            <a target="_blank" href="#"><img src="/images/xl-hover.png" title="微博"></a>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
</body>
</html>